package com.wsh.controller.sys;

import com.wsh.sys.DictService;
import com.wsh.sys.DictTypeService;
import com.wsh.utils.JsonResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 王思涵
 * @Date 2019/8/10
 * @Version 1.0
 * @Desciption 字典数据类型接口层
 **/
@RestController
@RequestMapping("/sys/")
public class DictTypeController {
    @Autowired
    private DictTypeService dictTypeService;

    @Autowired
    private DictService dictService;

    @GetMapping("/typeList")
    public Object typeList() {
        return JsonResult.success(dictTypeService.list());
    }

    @GetMapping("/dictByType")
    public Object dictByType(@RequestParam String type) {
        return JsonResult.success(dictService.getDictByType(type));
    }

}
